// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import promise from 'es6-promise'
import Vue from 'vue'
import App from './App'
import router from './router'
import httpServer from './api/http'
import api from './api/api'
import {
  Form,
  FormItem,
  Button,
  Input,
  Checkbox,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Select,
  Option,
  DatePicker,
  Message,
  Dialog,
  Tabs,
  TabPane,
  Table,
  TableColumn,
  Pagination,
  MessageBox,
  Upload
} from 'element-ui'
import Print from 'vue-print-nb'
promise.polyfill()
Vue.use(Print)

Vue.use(Form)
Vue.use(FormItem)
Vue.use(Button)
Vue.use(Input)
Vue.use(Checkbox)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Select)
Vue.use(Option)
Vue.use(DatePicker)
Vue.use(Dialog)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Upload)

Vue.prototype.$message = Message
Vue.prototype.$messagebox = MessageBox

Vue.prototype.$http = httpServer
Vue.prototype.$api = api
Vue.prototype.$bus = new Vue()

Vue.prototype.$BASE_URL = process.env.API_URL

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
